package model

import "github.com/hwcer/updater"

// 抽卡记录
func init() {
	Register(&Gacha{})
}

// Gacha
// OID  唯一，无意义
// iid 抽到的ID
// Key 池子ID
type Gacha struct {
	Model  `bson:"inline"`
	Pool   int32 `bson:"pool" json:"pool"` //卡池ID
	Update int64 `bson:"update" json:"update" index:"name:_idx_uid_primary,Sort:desc,Priority:100" `
}

func NewGacha(u *updater.Updater, iid int32, pool int32) *Gacha {
	i := &Gacha{}
	i.Model.Init(u, iid)
	i.Pool = pool
	i.Update = u.Unix()
	i.OID = ObjectId.Simple()
	return i
}
